package com.mlog.njyjy.ndop.msg.common.domain;

import com.jfinal.plugin.activerecord.Model;
import com.mlog.njyjy.ndop.msg.common.domain.core.Timeable;
import com.mlog.njyjy.ndop.msg.common.support.Constants;
import com.mlog.njyjy.ndop.share.sql.annotation.Column;
import com.mlog.njyjy.ndop.share.sql.annotation.Id;
import com.mlog.njyjy.ndop.share.sql.annotation.Table;
import com.mlog.njyjy.ndop.share.sql.annotation.TableUnique;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 消费者群组
 *
 * @author alex
 * @version v1.0 2020/7/7
 */
@Data
@Accessors(chain = true)
@Table(prefix = Constants.TBL_MSG_PREFIX, uniques = {@TableUnique(columns = {"name", "topic_id"})})
public class ConsumerGroup extends Model<ConsumerGroup> implements Timeable {

    @Id
    private Long id;

    @Column(nullable = false, comment = "消费组名称")
    private String name;

    @Column(nullable = false, comment = "关联主题ID")
    private Long topicId;

    /**
     * 描述
     */
    @Column(length = 255)
    private String description;

    /**
     * 创建时间
     */
    @Column(updatable = false)
    private LocalDateTime createAt;

    /**
     * 更新时间
     */
    private LocalDateTime updateAt;

}
